/************************************************************
 * Name: RedVMRegUpdateFilter.h
 *
 * Description:
 *
 *
 * History:
 *    Created: 
 *      v0: gxf. Nov. 22nd, 2008. 
 *
 *    Last Modified:
 *
 *
 ************************************************************/
#ifndef RED_VM_REG_UPDATE_FILTER_H
#define RED_VM_REG_UPDATE_FILTER_H

#include "crossbit/VFilter.h"
#include "crossbit/VBlock.h"
#include "crossbit/GLOBAL.h"

namespace crossbit{


class RedVMRegUpdateFilter : public VFilter
{
    public:
        XTUint32 run(VBlock *vb);

        inline static XTUint32 GetInstReduced(){
            return optCnt;
        }

    protected:
        void DeleteInst(VInst* curInst, VBlock* pBlock); 
        void DeleteInst(VInst* curInst, VBlock* pBlock, VBlock::vb_iterator& Itr);

    protected:
        VInst* table[GLOBAL::MAX_VREG];
        static XTUint32 optCnt;
};

}

#endif
